<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script src="__JS__/template-web.js"></script>
<script src="__JS__/template-web.js"></script>
<script id="ifTemplate" type="text/html">
    <ul>
        {{if male=='女'}}
        <li>欢迎您 {{name}} 女士
            <ol>
                <li>这是最新款的包包</li>
                <li>这是最新款的口红</li>
                <li>没想到,你竟然是{{skill}}</li>
            </ol>
        </li>
        {{else if male=='男'}}
        <li>欢迎您 {{name}} 先生
            <ol>
                <li>这是最新款的拖拉机</li>
                <li>讨厌,才来找人家</li>
                <li>没想到,你竟然稍长{{skill}}</li>
            </ol>
        </li>
        {{/if}}
    </ul>
</script>
<script>
    var person1 = {
        male: '女',
        name: '郑爽',
        skill: '身材好'
    };
    var person2 = {
        male: '男',
        name: '张翰',
        skill: '这篇鱼塘我承包了'
    };
    console.log(template('ifTemplate', person1));
    console.log(template('ifTemplate', person2));
</script>
</body>
</html>